﻿using GigaSite.Domain.DAL.Repositories;
using GigaSite.Domain.Interfaces.Repositories;
using Ninject.Modules;

namespace GigaSite.Domain.DAL
{
    /// <summary>
    /// Модуль регистрации зависимостей слоя доступа к данным
    /// </summary>
    public class DALRegistrationModule: NinjectModule
    {
        /// <summary>
        /// Регистрирует зависимости Слоя Доступа к БД в IoC контейнере
        /// </summary>
        public override void Load()
        {
            Kernel.Bind<GigaDataContext>().ToSelf().InRequestScope().WithConstructorArgument("connection", System.Configuration.ConfigurationManager.ConnectionStrings["GigaSiteConnectionString"].ConnectionString);
            Kernel.Bind<IUsersRepository>().To<UsersRepository>();
            Kernel.Bind<ICategoriesRepository>().To<CategoriesRepository>();
            Kernel.Bind<ICompaniesRepository>().To<CompaniesRepository>();
            Kernel.Bind<IShoppingMallsRepository>().To<ShoppingMallsRepository>();
            Kernel.Bind<IGoodsRepository>().To<GoodsRepository>();
            Kernel.Bind<IServicesRepository>().To<ServicesRepository>();
            Kernel.Bind<ISettingsRepository>().To<SettingsRepository>();
            Kernel.Bind<ICitiesRepository>().To<CitiesRepository>();
            Kernel.Bind<INewsRepository>().To<NewsRepository>();
            Kernel.Bind<IHomePageRepository>().To<HomePageRepository>();
            Kernel.Bind<IImagesRepository>().To<ImagesRepository>();
            Kernel.Bind<IBusinessCardsRepository>().To<BusinessCardsRepository>();
            Kernel.Bind<ISitesRepository>().To<SitesRepository>();
            Kernel.Bind<IAdvsRepository>().To<AdvsRepository>();
            Kernel.Bind<IAbusesRepository>().To<AbusesRepository>();
            Kernel.Bind<IVacanciesRepository>().To<VacanciesRepository>();
            Kernel.Bind<IResumesRepository>().To<ResumesRepository>();
        }
    }
}